package com.dili.dd.gpi.dto;

import com.dili.dd.gpi.enums.GPIType;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Gpi参数对象
 * Created by zhaoYuan on 2015/4/8.
 */
public class GpiParamDto {

    private Integer parentId;

    @NotNull(message = "{validator.gpi.type.notNull}")
    private GPIType type;

    @NotNull(message = "{validator.gpi.title.notNull}")
    @Pattern(regexp = "^(\\S{1,100})(,\\S{1,100})*$",message = "{validator.gpi.title.length}")
    private String title;


    @Length(max = 20,message = "{validator.gpi.prefix.length}")
    @Pattern(regexp = "^(([a-yA-Y]\\w+)|([zZ](?!\\d+$)\\w+))?$",message = "{validator.gpi.prefix.rule}")
    private String prefix;

    @Length(max = 20,message = "{validator.gpi.suffix.length}")
    @Pattern(regexp = "^[a-zA-Z]*$",message = "{validator.gpi.suffix.letter}")
    private String suffix;

    @Pattern(regexp = "^((\\S{1,200})(\\n\\S{1,200})*)?$",message = "{validator.gpi.describe.length}")
    private String describe;

    public GPIType getType() {
        return type;
    }

    public void setType(GPIType type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }
}
